package org.dtrd.modules.flup.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.flup.entity.bean.FlupFlowItem;
import org.dtrd.modules.flup.entity.bean.FlupProjectRecord;

import java.util.Date;


/**
 * <p>
 * 患者复诊项目检测数据
 * </p>
 *
 * @author QR
 * @since 2021-12-23
 */
@Getter
@Setter
@TableName("dtrd_rl_flup_project_record")
public class DtrdRlFlupProjectRecord {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 复诊预约id
     */
    @TableField("flup_appointment_id")
    private Integer flupAppointmentId;

    /**
     * 模版id
     */
    @TableField("template_id")
    private Integer templateId;

    @TableField("template_name")
    private String templateName;

    /**
     * 复诊项目id
     */
    @TableField("project_id")
    private Integer projectId;

    @TableField("project_name")
    private String projectName;

    @TableField("project_status")
    private Integer projectStatus;

    /**
     * 复诊项目数据
     */
    @TableField("project_data")
    private String projectData;

    /**
     * 复诊项目建议
     */
    @TableField("project_suggest")
    private String projectSuggest;

    /**
     * 操作员
     */
    @TableField("operator")
    private String operator;

    @TableField("create_time")
    private Date createTime;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    public DtrdRlFlupProjectRecord init() {
        createTime = new Date();
        isDel = 0;
        return this;
    }

    public DtrdRlFlupProjectRecord parseFromDTO(FlupProjectRecord dto) {
        projectSuggest = dto.getProjectSuggest();
        projectStatus = dto.getProjectStatus();
        operator = dto.getOperator();
        return this;
    }

    public DtrdRlFlupProjectRecord parseFromDTO(FlupFlowItem dto) {
        projectSuggest = dto.getRemark();
        projectStatus = dto.getProjectStatus();
        operator = dto.getExecutor();
        return this;
    }


}
